package service

import (
	"context"
	"google.golang.org/protobuf/types/known/emptypb"

	v1 "kratosEtcdWatcher/api/lottery/v1"
	"kratosEtcdWatcher/internal/biz"
)

type LotteryService struct {
	v1.UnimplementedLotteryServer

	uc *biz.LotteryUsecase
}

func NewLotteryService(uc *biz.LotteryUsecase) *LotteryService {
	return &LotteryService{uc: uc}
}

func (l *LotteryService) UpsertLottery(ctx context.Context, req *v1.UpsertLotteryRequest) (*emptypb.Empty, error) {
	return l.uc.UpsertLottery(ctx, req)
}

func (l *LotteryService) GetLotteryByActivityId(ctx context.Context, req *v1.GetLotteryByActivityIdReq) (*v1.GetLotteryByActivityIdReply, error) {
	return l.uc.GetLotteryByActivityId(ctx, req)
}
